package com.hiraeth.modules.monitor.model.sd;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * Azure服务发现配置列表
 * 
 * @author xuning
 *
 */
@Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class AzureSdConfig implements Serializable {

	private static final long serialVersionUID = 7398318329257926195L;

	/**
	 * Azure环境。默认Azure_public_cloud
	 */
	private String environment = "AzurePublicCloud";

	/**
	 * 身份验证方法，OAuth或Managed_identity
	 * 
	 * @see https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
	 */
	private String authentication_method = "OAuth";

	/**
	 * 订阅ID。必填。
	 */
	@NotNull
	private String subscription_id;

	/**
	 * 可选的租户ID。仅当authentication_method为OAuth时必填。
	 */
	private String tenant_id;

	/**
	 * 可选的客户端ID。仅当authentication_method为OAuth时必填。
	 */
	private String client_id;

	/**
	 * 可选的客户端密钥。仅当authentication_method为OAuth时必填。
	 */
	private String client_secet;

	/**
	 * 刷新间隔以重新读取实例列表。默认300s
	 */
	private String refresh_interval;

	/**
	 * The port to scrape metrics from. If using the public IP address, this must
	 * instead be specified in the relabeling rule. default=80
	 */
	private int port;

}
